package com.example.film.mapper;

import com.example.film.entity.FilmWeekSell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FilmWeekSellMapper {
    //查看每周影片票房信息
    @Select("select filmName,session,people,box_office,showDate,totalSell,week from filmweeksell")
    List<FilmWeekSell> findFilmWeekSell();

    //分页查询每周影片票房信息
    @Select("select filmName,session,people,box_office,showDate,totalSell,week from filmweeksell LIMIT #{pageSize} OFFSET #{startIndex}")
    List<FilmWeekSell> findFilmWeekSellInfo(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    //根据周数查询每周影片票房信息
    @Select("select filmName,session,people,box_office,showDate,totalSell,week from filmweeksell where week=#{week}")
    List<FilmWeekSell> findFilmWeekSellByWeek(Integer week);
}
